using System;
using System.Collections.Generic;
using System.Text;
using Utility;
using DAL;
using DTO;
namespace BUS
{
   public class tbTinhTrangThanhToanBUS
    {
       public static void Insert(tbTinhTrangThanhToan tinhtrangthanhtoan)
        {
            tbTinhTrangThanhToanDAL ttttDAL = new tbTinhTrangThanhToanDAL();
            ttttDAL.Insert(tinhtrangthanhtoan);
        }
       public static void Update(tbTinhTrangThanhToan tinhtrangthanhtoan)
        {
            tbTinhTrangThanhToanDAL ttttDAl = new tbTinhTrangThanhToanDAL();
           ttttDAl.Update(tinhtrangthanhtoan);
        }
        public static void Delete(int iD)
        {
            tbTinhTrangThanhToanDAL ttttDAl = new tbTinhTrangThanhToanDAL();
            ttttDAl.Delete(iD);
        }
       public static tbTinhTrangThanhToanCollection Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbTinhTrangThanhToanDAL ttttDAL = new tbTinhTrangThanhToanDAL();
            return ttttDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
       public static tbTinhTrangThanhToanCollection GetAll()
        {
            int total = 0;
            Criteria cri = new Criteria();
            tbTinhTrangThanhToanDAL ttttDAL = new tbTinhTrangThanhToanDAL();
            return ttttDAL.Get(cri.Criter, 0, 0, tbTinhTrangThanhToanColumns.matttt.ToString(), OrderDirection.ASC.ToString(), out total);
        }
       public static tbTinhTrangThanhToan GetByID(int iD)
        {
            int total = 0;
            Criteria cri = new Criteria();
            cri.add(Condition.AND, tbTinhTrangThanhToanColumns.matttt.ToString(), Condition.EQUAL, iD);
            tbTinhTrangThanhToanDAL ttttDAL = new tbTinhTrangThanhToanDAL();
            tbTinhTrangThanhToanCollection ttttCollection = ttttDAL.Get(cri.Criter, 0, 0, tbTinhTrangThanhToanColumns.matttt.ToString(), OrderDirection.ASC.ToString(), out total);
            if (ttttCollection.Count > 0)
                return ttttCollection[0];
            return null;
        }
       public static tbTinhTrangThanhToanCollection GetLimited(int number)
        {
            int total = 0;
            Criteria cri = new Criteria();
            tbTinhTrangThanhToanDAL ttttDAL = new tbTinhTrangThanhToanDAL();
            return ttttDAL.Get(cri.Criter, 1, number, tbTinhTrangThanhToanColumns.matttt.ToString(), OrderDirection.DESC.ToString(), out total);
        }
       public static tbTinhTrangThanhToanCollection GetPromotion(int number)
        {
            int total = 0;
            Criteria cri = new Criteria();
            tbTinhTrangThanhToanDAL ttttDAL = new tbTinhTrangThanhToanDAL();
            return ttttDAL.Get(cri.Criter, 1, number, tbTinhTrangThanhToanColumns.matttt.ToString(), OrderDirection.DESC.ToString(), out total);
        }
    }
}
